package com.huiminpay.transaction.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huiminpay.transaction.api.dto.PayChannelDTO;
import com.huiminpay.transaction.entity.PlatformChannel;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2019-11-15
 */
@Repository
public interface PlatformChannelMapper extends BaseMapper<PlatformChannel> {
    /**
     * 根据服务类型code查询对应的支付渠道
     * @param platformChannelCode   服务类型编码
     * @return
     */
    @Select("SELECT \n" +
            "pc.*\n" +
            "FROM\n" +
            "pay_channel pc,\n" +
            "platform_pay_channel ppc\n" +
            "WHERE\n" +
            "pc.CHANNEL_CODE = ppc.PAY_CHANNEL\n" +
            "AND ppc.PLATFORM_CHANNEL=#{platformChannelCode}")
    List<PayChannelDTO> selectPayChannelByPlatformChannel(String platformChannelCode);


}
